package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 计量单位
 * @TableName units
 */
@TableName(value ="units")
@Data
public class Units implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 单位
     */
    private String unit;

    /**
     * 单位名称
     */
    private String unitName;

    /**
     * 是否为主单位(0:是，1否)
     */
    private String isPrimaryUnit;

    /**
     * 主单位编码
     */
    private String primaryUnitId;

    /**
     * 换算比例
     */
    private BigDecimal conversionRatio;

    /**
     * 是否启用(0:启用，1禁用)
     */
    private String isEnabled;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 
     */
    private String column8;

    /**
     * 
     */
    private String column9;

    /**
     * 
     */
    private String column10;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Units other = (Units) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
            && (this.getUnitName() == null ? other.getUnitName() == null : this.getUnitName().equals(other.getUnitName()))
            && (this.getIsPrimaryUnit() == null ? other.getIsPrimaryUnit() == null : this.getIsPrimaryUnit().equals(other.getIsPrimaryUnit()))
            && (this.getPrimaryUnitId() == null ? other.getPrimaryUnitId() == null : this.getPrimaryUnitId().equals(other.getPrimaryUnitId()))
            && (this.getConversionRatio() == null ? other.getConversionRatio() == null : this.getConversionRatio().equals(other.getConversionRatio()))
            && (this.getIsEnabled() == null ? other.getIsEnabled() == null : this.getIsEnabled().equals(other.getIsEnabled()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()))
            && (this.getColumn8() == null ? other.getColumn8() == null : this.getColumn8().equals(other.getColumn8()))
            && (this.getColumn9() == null ? other.getColumn9() == null : this.getColumn9().equals(other.getColumn9()))
            && (this.getColumn10() == null ? other.getColumn10() == null : this.getColumn10().equals(other.getColumn10()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
        result = prime * result + ((getUnitName() == null) ? 0 : getUnitName().hashCode());
        result = prime * result + ((getIsPrimaryUnit() == null) ? 0 : getIsPrimaryUnit().hashCode());
        result = prime * result + ((getPrimaryUnitId() == null) ? 0 : getPrimaryUnitId().hashCode());
        result = prime * result + ((getConversionRatio() == null) ? 0 : getConversionRatio().hashCode());
        result = prime * result + ((getIsEnabled() == null) ? 0 : getIsEnabled().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        result = prime * result + ((getColumn8() == null) ? 0 : getColumn8().hashCode());
        result = prime * result + ((getColumn9() == null) ? 0 : getColumn9().hashCode());
        result = prime * result + ((getColumn10() == null) ? 0 : getColumn10().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", unit=").append(unit);
        sb.append(", unitName=").append(unitName);
        sb.append(", isPrimaryUnit=").append(isPrimaryUnit);
        sb.append(", primaryUnitId=").append(primaryUnitId);
        sb.append(", conversionRatio=").append(conversionRatio);
        sb.append(", isEnabled=").append(isEnabled);
        sb.append(", remarks=").append(remarks);
        sb.append(", column8=").append(column8);
        sb.append(", column9=").append(column9);
        sb.append(", column10=").append(column10);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}